<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@page import="model.JsfCoach"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>课程信息修改</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body>
<%
	JsfCoach coach = (JsfCoach) session.getAttribute("coach");
	int ps = coach.getStatus();
%>
	<s:form action="class_edit" method="post" enctype="multipart/form-data"
		onsubmit="return check()" name="f1">
		<table>
			<s:iterator value="jsfclass" var="var">
		<tr><td>课程名称:</td><td><input type="text" name="name" value='<s:property value="#var.name" />'>
		<input type="hidden" name="classId" value='<s:property value="#var.id" />'>
		<font color="red">*</font></td></tr>
		<tr><td>开始时间:（原时间）<s:property value="#var.beginTime" />
		</td><td><input type="date" name="beginTime">
		<font color="red">*</font></td></tr>
		<tr><td>结束时间:（原时间） <s:property value="#var.endTime" />
		</td><td><input type="date" name="endTime">
		<font color="red">*</font></td></tr>
		<tr><td>地址:</td><td><input type="text" name="place" id="place" value='<s:property value="#var.place" />'>
		<font color="red">*</font></td></tr>
		<tr><td>最大人数:</td><td><input type="text" name="clientNumMax" value='<s:property value="#var.clientNumMax" />'>
		<font color="red">*</font></td></tr>
		<tr><td>价格:</td><td><input type="text" name="priceEveryone" value='<s:property value="#var.priceEveryone" />'>
		<font color="red">*</font></td></tr>
		<tr><td>其他信息:</td><td>
		<input type='text' size="200" name="detail" value='<s:property value="#var.detail" />'></input>
		<font color="red">*</font></td></tr>
		<tr><td><input type="submit" value="保存" class="btn btn-info">
		<input type="button" value="返回" class="btn btn-info"
		onclick="location.href ='class_findall?level=0';" />
		</td></tr>
			</s:iterator>
		</table>
	</s:form>
	<script type="text/javascript">
   function check(){
		var name = document.f1.name;
		var place = document.f1.place;
		var detail = document.f1.detail;
		var clientNumMax = document.f1.clientNumMax;
		var priceEveryone = document.f1.priceEveryone;
		var beginTime = document.f1.beginTime;
		var endTime = document.f1.endTime;
		var reNum =/^[0-9]+$/;
		if(name.value==""||place.value==""||detail.value==""||clientNumMax.value==""
		||priceEveryone.value==""||beginTime.value==""||endTime.value==""){
			alert("必填项不能为空！");
			return false;
		}
		if(!reNum.test(clientNumMax.value) || !reNum.test(priceEveryone.value)){
			alert("“价格和最大人数必须为数字！");
			return false;
		}
		
		else{
			return true;
		}
	}
    </script>
</body>
</html>